package com.cloud.tsp.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.cloud.api.domain.job.QueryService;
import com.cloud.api.domain.job.ServiceStation;
import com.cloud.mybatis.domain.TableDataInfo;
import com.cloud.tsp.mapper.ServiceStationMapper;
import com.cloud.tsp.service.IServiceStationService;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;

/**
 * <p>
 * OLAP 服务实现类
 * </p>
 *
 * @author haohaibo
 * @since 2023-12-01
 */
@Service("serviceStationService")
public class ServiceStationImpl extends ServiceImpl<ServiceStationMapper, ServiceStation> implements IServiceStationService {

    @Resource
    private ServiceStationMapper serviceStationMapper;

    @Override
    public TableDataInfo<ServiceStation> selectServiceStationList(QueryService para) {
        Page<ServiceStation> page = new Page<>(para.getPage(), para.getPageSize());
        IPage<ServiceStation> data = serviceStationMapper.selectServiceStationList(page, para);
        return TableDataInfo.build(data);
    }

    @Override
    public void InsertOrUpdateServiceStation(ServiceStation para) {
        this.saveOrUpdate(para);
    }
}